<script>
/*
 * Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
 * This file is part of RockStor.
 *
 * RockStor is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * RockStor is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */
</script>
<div class="messages"></div>
<div class="pull-left custom-padding">
  {{#if collectionNotEmpty}}
    <a class="btn btn-primary" href="#" id="js-snapshot-add"><i class="glyphicon glyphicon-edit "></i> Create</a>
  <a class="btn btn-danger" href="#" id="js-snapshot-delete-multiple" style="visibility:hidden;"><i class="glyphicon glyphicon-trash "></i> Delete selected</a>
  {{/if}}
</div>
{{#if collectionNotEmpty}}
  <table id="snapshots-table" class="table table-condensed table-bordered table-hover table-striped share-table tablesorter" summary="List of snapshots">
    <thead>
      <tr>
        <th>
          <input class="js-snapshot-select-all inline" type="checkbox" name="snapshot-select-all" ></input>
        </th>
        <th>Name</th>
        <th>Created on</th>
        <th>Visibility to user</th>
        <th>Writable</th>
        <th>Total Size</th>
	    <th>Exclusive Size</th>
      </tr>
    </thead>
    <tbody>
      {{#each snapshots}}
          <tr>
              <td>{{printCheckboxes this.name this.id}}</td>
              <td><i class="glyphicon glyphicon-camera"></i> {{this.name}} &nbsp;&nbsp;&nbsp;&nbsp;
              {{#if this.writable}}
                <a class="js-snapshot-clone" href="#" data-name="{{this.name}}"><i rel="tooltip" title="Clone snapshot" class="glyphicon glyphicon-book"></i></a>&nbsp;
              {{/if}}
              <a href="#" class="js-snapshot-delete" id="delete_snapshot_{{this.name}}" data-name="{{this.name}}" data-size="{{getSize this.eusage}}" 
              data-share-name="{{this.share.name}}" data-action="delete" title="Delete snapshot"><i rel="tooltip" title="Delete snapshot" class="glyphicon glyphicon-trash"></i></a>
              </td>
              <td>{{getToc this.toc}}</td>
               <td>
               {{#if this.uvisible}}
                    Visible
               {{else}}
                    Hidden
               {{/if}}
               </td>
               <td>
               {{#if this.writable}}
                    Yes
               {{else}}
                    No
               {{/if}}
               </td>
               <td>{{getSize this.rusage}}</td>
               <td>{{getSize this.eusage}}</td>
          </tr>
      {{/each}}
    </tbody>
  </table>
<div>{{pagination}}</div>
{{else}}
  <div class="share-snapWarning"><p>There are no snapshots. <a href="#" id="js-snapshot-add">click here </a>to create</p></div>
{{/if}}